from Highlighter import Highlighter

__author__ = 'deadmoroz'

import unittest

class IntegrationTests(unittest.TestCase):
    def setUp(self):
        self.highlighter = Highlighter()

    def testIniFile(self):
        ini = """
;Settings relating to the location and loading of the database
[Database]
ProfileDir=.
ShowProfileMgr=smart
Profile1_Name[] = "\|/_-=MegaDestoyer=-_\|/"
DefaultProfile=True

[AutoExec]
Use="prompt"
Glob=autoexec_*.ini
AskAboutIgnoredPlugins=0
"""
        html = """
<span class="comment">;Settings relating to the location and loading of the database</span>
<span class="title">[Database]</span>
<span class="setting">ProfileDir=<span class="value">.</span></span>
<span class="setting">ShowProfileMgr=<span class="value">smart</span></span>
<span class="setting">Profile1_Name[] = <span class="value"><span class="string">"\|/_-=MegaDestoyer=-_\|/"</span></span></span>
<span class="setting">DefaultProfile=<span class="value"><span class="keyword">True</span></span></span>

<span class="title">[AutoExec]</span>
<span class="setting">Use=<span class="value"><span class="string">"prompt"</span></span></span>
<span class="setting">Glob=<span class="value">autoexec_*.ini</span></span>
<span class="setting">AskAboutIgnoredPlugins=<span class="value"><span class="number">0</span></span></span>
"""

        self.assertEquals(self.highlighter.highlight("ini", ini), html)


    if __name__ == '__main__':
        unittest.main()
